import * as authCookie from '@/utils/auth'
const user = {
    state: {
        token: authCookie.getToken(),
        userInfo: authCookie.getUserInfo(),
        userId: authCookie.getUserId(),
    },
    mutations: {
        SET_TOKEN: (state, token) => {
            state.token = token
            authCookie.setToken(token)
        },
        SET_USER_INFO: (state, info) => {
            state.userInfo = info
            authCookie.setUserInfo(info)
        },
        SET_USER_ID: (state, info) => {
            // eslint-disable-next-line
            console.log(info)
            state.userId = info
            authCookie.setUserId(info)
        },
    },
    actions: {

    }
}
export default user